/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');

exports.OptionRule = {
    'NORMAL': 1,    // 推倒胡
}

var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.MenQing = 201;        // 门清
ScoreRule.WuHuaGuo = 202;       //无花果
ScoreRule.HunYiSe =  203;       // 混一色
ScoreRule.QingYiSe =  204;      // 清一色

ScoreRule.HuangFan =  205;      // 荒番局
ScoreRule.DiFen =  208;      // 底花 2
ScoreRule.KeZi =  209;      // 刻子
ScoreRule.GangFen =  210;      // 杠分
ScoreRule.HuaFen =  211;      // 补花
ScoreRule.shouHua =  216;      // 手花
ScoreRule.CangYing =  217;      // 苍蝇


ScoreRule.PAIR =  206;      // 碰碰胡
ScoreRule.SINGLE =  207;      // 大吊
ScoreRule.PAIR7 =  212;      // 七对
ScoreRule.H1PAIR7 =  213;      // 豪华七对
ScoreRule.H2PAIR7 =  214;      // 双豪华七对
ScoreRule.H3PAIR7 =  215;      // 三豪华七对


var Pattern = {
    'NONE': 0,                      // 不是可胡的牌型
    'NORMAL': MJ.Pattern.NORMAL,    // 平胡  1
    'PAIR7': MJ.Pattern.PAIR7,    // 七对  3
    'ZM': 5,                        // 自摸
    'QG': 8,                        // 抢杠

    'H1PAIR7': 9,
    'H2PAIR7': 9,
};

var PatternScore = {};

PatternScore[Pattern.NORMAL] = 1;

PatternScore[Pattern.QingYiSe] = 1;
PatternScore[Pattern.HunYiSe] = 1;

PatternScore[Pattern.QG] = 3;

PatternScore[Pattern.ZM] = 1;


var ItemScore = {};
ItemScore[ScoreRule.QG] = 3;

ItemScore[ScoreRule.GSH] = 1;

ItemScore[ScoreRule.MenQing] = 1;

ItemScore[ScoreRule.WuHuaGuo] = 0;
ItemScore[ScoreRule.HuangFan] = 1;

ItemScore[ScoreRule.QingYiSe] = 2;
ItemScore[ScoreRule.HunYiSe] = 1;
ItemScore[ScoreRule.PAIR7] = 1;
ItemScore[ScoreRule.H1PAIR7] = 1;

ItemScore[ScoreRule.PAIR] = 1;
ItemScore[ScoreRule.SINGLE] = 1;


var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸


    BT: ScoreRule.BT, // 报听
    LZ: ScoreRule.LZ, // 庄家
    QG: ScoreRule.QG, // 抢杠
};

var GangScore = {};
GangScore[MJ.Gang.BA] = 2;
GangScore[MJ.Gang.AN] = 4;
GangScore[MJ.Gang.DIAN] = 2;
GangScore[MJ.Gang.ANS] = 4;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;